package com.tanhua.model.vo;

import com.tanhua.model.db.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @auther : 白月尘
 * @date : 8:40  2021/11/1
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
public class PeachblossomVo implements Serializable {
    private Long id; //用户id
    private String avatar; //用户头像
    private String nickname; //昵称
    private String gender; //性别
    private Integer age; //年龄
    private String soundUrl; //语音地址


    private Integer remainingTimes; //剩余次数


    public static PeachblossomVo init(UserInfo userInfo) {
        PeachblossomVo vo = new PeachblossomVo();
        vo.setId(userInfo.getId());
        vo.setAvatar(userInfo.getAvatar());
        vo.setNickname(userInfo.getNickname());
        vo.setGender(userInfo.getGender());
        vo.setAge(userInfo.getAge());
        return vo;
    }
}
